package liguo.util;

import android.util.Log;

/**
 * 日志打印框架
 * Created by Extends on 2016/11/30.
 */
public final class L{
    public static String TAG = "L";
    public static boolean isShow = true;

    /**
     * java类调用的error打印方法
     * kotlin直接调用ke方法
     * @param msgs
     */
    public static void je(String... msgs){
        StackTraceElement targetElement = Thread.currentThread().getStackTrace()[3];
        String className = targetElement.getClassName();
        String[] classNameInfo = className.split("\\.");
        if (classNameInfo.length > 0) {
            className = classNameInfo[classNameInfo.length - 1];
        }
        if (className.contains("$")) {
            className = className.split("\\$")[0];
        }
        String msg = msgs[0];
        for(int i=1;i<msgs.length;i++){
            msg +="\n"+msgs[i];
        }
        Log.e("L.je","("+className+".java:"+targetElement.getLineNumber()+")\tMethodName："+targetElement.getMethodName()+"\nThread："+ Thread.currentThread().getName()+"\n"+msg);
    }
}

